# Maintainer: Antonio Rojas <arojas@archlinux,org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=konqueror
pkgver=21.08.1
pkgrel=2
pkgdesc='KDE File Manager & Web Browser'
arch=(x86_64)
url='https://apps.kde.org/konqueror/'
license=(LGPL)
depends=(dolphin keditbookmarks qt5-webengine qt5-script kinit)
makedepends=(extra-cmake-modules kdoctools kdesu hunspell)
optdepends=('kdesu: shell command plugin')
groups=(kde-applications kde-network)
source=(https://download.kde.org/stable/release-service/$pkgver/src/$pkgname-$pkgver.tar.xz{,.sig}
        https://invent.kde.org/network/konqueror/-/commit/6a46c0c8.patch)
sha256sums=('f0c0aed44c25928b92e21e55cb76182e64297eba5647797911f9cdd12c62ad94'
            'SKIP'
            '18d8b396a5390d2cb3c3b10213503e45149be3b06aeda1be3afa22f13c2945c7')
validpgpkeys=(CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7  # Albert Astals Cid <aacid@kde.org>
              F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87  # Christoph Feck <cfeck@kde.org>
              D81C0CB38EB725EF6691C385BB463350D6EF31EF) # Heiko Becker <heiko.becker@kde.org>

prepare() {
  patch -d $pkgname-$pkgver -p1 < 6a46c0c8.patch # Prevent pages from opening in external apps or new tabs
}

build() {
  cmake -B build -S $pkgname-$pkgver \
    -DBUILD_TESTING=OFF \
    -DWEBENGINEPART_DICTIONARY_DIR=/usr/share/qt/qtwebengine_dictionaries
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build
}
